package com.wphmoon.lesson.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.wphmoon.lesson.domain.MyUser;


@Mapper
public interface MyUserMapper {

    @Select("SELECT * FROM MY_USER WHERE NAME = #{name}")
    MyUser findByName(@Param("name") String name);
    
    @Select("SELECT * FROM MY_USER WHERE ID = #{id}")
    MyUser findById(@Param("id") Long id);

    @Insert("INSERT INTO MY_USER(NAME, NICKNAME,AGE,BIRTHDAY,MEMO) VALUES(#{name},#{nickname},#{age},#{birthday},#{memo})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void insert(MyUser myUser);
    
    

}